package com.ftg.learn.chapter05;

import com.ftg.learn.chapter05.dao.StudentDao;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Data Access
 *   Transaction Management
 *     事务管理  :
 *       setAutoCommit(false);
 *
 *       commit();
 *
 *       rollback();
 *
 * @author kangjx
 * @date 2022/11/8
 */
public class LearnDaoAccess {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext a = new AnnotationConfigApplicationContext();
        a.scan("com.ftg.learn.chapter05");
        a.refresh();

        StudentDao studentDao = a.getBean(StudentDao.class);
        System.out.println(studentDao.showAll1());
    }

}
